package com.winit.feature.service;

import com.winit.common.base.ExecuteResult;
import com.winit.feature.manager.FeatureManager;
import com.winit.feature.manager.PathContainer;
import com.winit.feature.model.Feature;
import com.winit.feature.repository.FeatureRepository;
import com.winit.page.model.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class FeatureServiceImpl implements IFeatureService {
    @Autowired
    private FeatureManager featureManager;
    @Autowired
    private PathContainer pathContainer;

    @Override
    public void createPrototypeForPage(Page page) {
        this.featureManager.createPrototypeForPage(page);
    }

    @Override
    public ExecuteResult deleteFeature(String featureId) {
        pathContainer.remove(featureId);
        return this.featureManager.deleteFeature(featureId);
    }
}
